<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Founder_model extends CI_Model
{	
	public function __construct()
	{
		parent::__construct();
	}
	
/*	public function get_recent_tasks()
	{
		return $this->db->order_by('id','DESC')->get('tasks',5)->result();
	}*/
	
	public function get_recent_tasks(){
		$this->db->select('tasks.project_id,tasks.*,projects.*,projects.id AS pro_id,tasks.id AS id' );
		$this->db->from('tasks');
		$this->db->join('projects','projects.id = tasks.project_id');
		$this->db->order_by('tasks.id','DESC');
		$this->db->limit('5');
		return $this->db->get()->result();
	}
	
	public function get_recent_project()
	{
		return $this->db->order_by('id','DESC')->get('projects',5)->result();
	}	
	
	public function active_user()
	{
		return $this->db->get_where('users',array('online_status'=>1))->result();		
	}
	
	public function inactive_user()
	{
		return $this->db->get_where('users',array('online_status'=>0))->result();		
	}
	
}
